---@diagnostic disable: undefined-global, lowercase-global
workspace "Orange"
	architecture "x32"
	configurations {
		"Debug",
		"Release",
		"Dist"
	}

	outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"

	IncludeDir = {}
	IncludeDir["GLFW"] = "Orange/vendor/GLFW/include"
	IncludeDir["Glad"] = "Orange/vendor/Glad/include"
	IncludeDir["ImGui"] = "Orange/vendor/imgui"
	IncludeDir["glm"] = "Orange/vendor/glm"


	


project "Orange"
		location "Orange"
		kind "SharedLib"
		language "C++"
		cppdialect "c++17"
		staticruntime "on"

		files{
			-- Glad start --

	

			-- Glad end --
			"%{prj.name}/src/**.h",
			"%{prj.name}/src/**.cpp",

			-- glm start --
			"%{prj.name}/vendor/glm/glm/**.hpp",
			"%{prj.name}/vendor/glm/glm/**.inl",
			-- glm end --

	

			-- imgui start --
			"%{prj.name}/vendor/imgui/imconfig.h",
			"%{prj.name}/vendor/imgui/imgui.h",
			"%{prj.name}/vendor/imgui/imgui.cpp",
			"%{prj.name}/vendor/imgui/imgui_draw.cpp",
			"%{prj.name}/vendor/imgui/imgui_internal.h",
			"%{prj.name}/vendor/imgui/imgui_widgets.cpp",
			"%{prj.name}/vendor/imgui/imstb_rectpack.h",
			"%{prj.name}/vendor/imgui/imstb_textedit.h",
			"%{prj.name}/vendor/imgui/imstb_truetype.h",
			"%{prj.name}/vendor/imgui/imgui_demo.cpp",
			-- imgui end --

		}

		targetdir ("bin/" .. outputdir .. "/%{prj.name}")
		objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
		
		pchheader "orangepch.h"
		pchsource "Orange/src/orangepch.cpp"

		includedirs
		{
			"%{prj.name}/vendor/spdlog/include",
			"%{prj.name}/src",
			"%{IncludeDir.GLFW}",
			"%{IncludeDir.Glad}",
			"%{IncludeDir.ImGui}",
			"%{IncludeDir.glm}",
		}

		libdirs  {
			"lib"
		}

		links {
			"glfw3dll",
			"opengl32"
		}
		postbuildcommands
		{
			("{COPY} ../dll/glfw3.dll ../bin/" .. outputdir .. "/Sandbox"),
			("{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox")

		}
		defines
		{
			"GLFW_INCLUDE_NONE",
			"_CRT_SECURE_NO_WARNINGS"
		}
		filter "system:windows"
			systemversion "latest"
			defines
			{
				"ORANGE_PLATFORM_WINDOWS"
			}
		
		filter "system:not windows"
			systemversion "latest"
			defines
			{
				"ORANGE_PLATFORM_OSX"
			}
	
	

		filter "configurations:Debug"
			defines {
				"ORANGE_DEBUG",
				"DORANGE_ENABLE_ASSERT"
			}
			runtime "Debug"
			symbols "on"
		filter "configurations:Release"
			defines "ORANGE_RELEASE"
			runtime "Release"
			optimize "on"
		filter "configurations:Dist"
			defines "ORANGE_DIST"
			runtime "Release"
			optimize "on"


project "Sandbox"
			location "Sandbox"
			kind "ConsoleApp"
			language "c++"
	
			targetdir ("bin/" .. outputdir .. "/%{prj.name}")
			objdir ("bin-int/" .. outputdir .. "/%{prj.name}")
	
			files{
				"%{prj.name}/src/**.h",
				"%{prj.name}/src/**.cpp",
			}
	
			
	
			includedirs
			{
				"Orange/vendor/spdlog/include",
				"Orange/src",
				"%{IncludeDir.glm}"
			}
	
			links
			{
				"Orange"
			}
	

			filter "system:windows"
				cppdialect "c++17"
				staticruntime "On"
				systemversion "latest"
				defines
				{
					"ORANGE_PLATFORM_WINDOWS"
				}
			
			filter "system:not windows"
				cppdialect "c++17"
				staticruntime "On"
				systemversion "latest"
				defines
				{
					"ORANGE_PLATFORM_OSX"
				}
		
			filter "configurations:Debug"
				defines {
					"RPG_DEBUG",
					"RPG_ENABLE_ASSERT"
				}
				symbols "On"
			filter "configurations:Release"
				defines "RPG_RELEASE"
				optimize "On"
			filter "configurations:Dist"
				defines "RPG_DIST"
				optimize "On"